/***************************************************************
|	File:		CellAnimation.h
|	Author:		
|	Course:		
|	Purpose:	CellAnimation class runs a fixed-size animation
|				from frame 0 -> n-1
***************************************************************/

#pragma once

#include "Animation.h"

//#include "../SGD Wrappers/SGD_Handle.h"
//#include "../SGD Wrappers/SGD_Color.h"
//#include "../SGD Wrappers/SGD_Geometry.h"


/**************************************************************/
// CellAnimation class
//	- runs animation using an image of fixed-size frames
//	- image MUST have a size power-of-2 (e.g. 64, 128, 256, 512)
class CellAnimation : public Animation
{
public:
	/**********************************************************/
	// Default Constructor & Destructor
	CellAnimation( void )	= default;
	~CellAnimation( void )	= default;

	/**********************************************************/
	// Initialize & Terminate
	void	Initialize	( const char * _filename );	
	void	Terminate	( void );


	/**********************************************************/
	// Animation Controls:
	void	Update		( float elapsedTime );
	void	Render		( SGD::Point position, bool flipped, float scale, SGD::Color color );

	

private:
	// cell data
	int				m_nNumRows		= 0;
	int				m_nNumCols		= 0;
	int				m_nFrameWidth	= 0;
	int				m_nFrameHeight	= 0;

	// animation data
	int				m_nNumFrames	= 0;
	
	float			m_fDuration		= 0.0f;		// per frame	
};

